package com.wuxiaofan.coupon.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaofan.coupon.entity.SmsSkuFullReduction;
import com.wuxiaofan.coupon.entity.custom.SmsSkuFullReductionCustom;
import com.wuxiaofan.coupon.mapper.SmsSkuFullReductionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuxiaofan.coupon.client.Idgenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

@Service
public class SmsSkuFullReductionService {
    @Autowired
    private SmsSkuFullReductionMapper smsSkuFullReductionMapper;
    @Resource
    private Idgenerator idgenerator;
    public SmsSkuFullReduction findById(String id){
        return smsSkuFullReductionMapper.selectById(id);
    }

    public SmsSkuFullReductionCustom findCountByMap(Map paraMap){
        return smsSkuFullReductionMapper.findCountByMap(paraMap);
    }

    public SmsSkuFullReductionCustom findGroupByMap(Map paraMap){
        return smsSkuFullReductionMapper.findGroupByMap(paraMap);
    }

    public List<SmsSkuFullReductionCustom> findByMap(Map paraMap){
        return smsSkuFullReductionMapper.findByMap(paraMap);
    }

    public Page<SmsSkuFullReductionCustom> findByMap(Map paraMap, Page page){
        return page.setRecords(smsSkuFullReductionMapper.findByMap(paraMap,page));
    }


    public void updateMapById(Map paraMap){
        smsSkuFullReductionMapper.updateMapById(paraMap);
    }
    public void delById(String id){
        smsSkuFullReductionMapper.deleteById(id);
    }

    public SmsSkuFullReduction save(SmsSkuFullReduction smsSkuFullReduction){
        smsSkuFullReduction.setId(idgenerator.getId());
        smsSkuFullReductionMapper.insert(smsSkuFullReduction);
        return smsSkuFullReduction;
    }

}
